﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListSupplyPlan.aspx.cs" Inherits="lcs.Web.supply.ListSupplyPlan"  EnableEventValidation="false" %>

<%@ Register assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagprefix="webdiyer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
    <link href="../../css/myStyle.css" rel="stylesheet" />
    <link href="../style.css" type="text/css" rel="stylesheet" />
    <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../Scripts/JsTools.js" type="text/javascript"></script>
    <script src="../My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript">

        function OpenPop(val, w, h) {
            if (true == window.showModalDialog(val, window.self, "dialogwidth=" + w + ";dialogheight=" + h + ";" + " resizable:yes;")) {
                __doPostBack('btn_reload', 'btn_reload_Click');
            }

        }

       
    </script>

     <link href="../../jquery-ui.min.css" rel="stylesheet" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
         $(function () {
             $("#txt_projectName").autocomplete({
                 minLength: 1, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { label: item.projectName + item.proid, value: item.projectName };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
         </script>
</head>
<body style="font-size: 9pt;">
    <form id="form1" runat="server">
    <table cellpadding="0" cellspacing="0" class="style1">
        <tr>
            <td style=" height:15px;">
                &nbsp;</td>
        </tr>
        <tr>
            <td style=" height:15px; text-align:center;">
                <b>生成当月供应计划</b></td>
        </tr>
        <tr>
            <td style=" height:15px;">
                &nbsp;</td>
        </tr>
         <tr>
            <td style=" height:15px;">
                 项目名称：<asp:TextBox ID="txt_projectName" runat="server"></asp:TextBox>
&nbsp; 物料描述：<asp:TextBox ID="txt_material" runat="server"></asp:TextBox>
&nbsp;供货商：<asp:TextBox ID="txt_supplier" runat="server"></asp:TextBox>
                 &nbsp;</td>
        </tr>
         <tr>
            <td style=" height:15px;">
                 供货期：<asp:TextBox ID="txt_ghqStart" runat="server" 
                     onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" Width="80px"></asp:TextBox>
                 至<asp:TextBox ID="txt_ghqEnd" runat="server" 
                     onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" Width="80px"></asp:TextBox>
                 <asp:RadioButton ID="rdo_all" runat="server" Checked="True" GroupName="rdo" 
                     Text="全部" />
                 <asp:RadioButton ID="rdo_ysc" runat="server" GroupName="rdo" Text="已生成月供应计划" />
                 <asp:RadioButton ID="rdo_wsc" runat="server" GroupName="rdo" Text="未生成月供应计划" />
                 <asp:Button ID="btn_sel" runat="server" CssClass="btn" onclick="btn_sel_Click" 
                    Text="查询" /></td>
        </tr>
         <tr>
            <td style=" height:15px;">
                 &nbsp;</td>
        </tr>
         <tr>
            <td style=" height:15px;">
                <asp:Label ID="lbl_dsCount" runat="server"></asp:Label>
             </td>
        </tr>
        <tr>
            <td style=" height:15px; text-align:center;">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" GridLines="None"
                    onrowcommand="GridView1_RowCommand" Width="2300px" 
                    onrowdatabound="GridView1_RowDataBound" PageSize="30">
                    <Columns>
                        <asp:TemplateField HeaderText="选择">
                              <HeaderTemplate>
                            <input id="cbo_checkAll" type="checkbox" onclick="checkall(this)" />全选
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="cbo_check" runat="server" />
                                <asp:Label ID="lbl_supplyPlanIdV" runat="server" 
                                    Text='<%# Bind("supplyPlanId") %>' Visible="False"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                                <asp:LinkButton ID="lbn_add" runat="server" 
                                    CommandArgument='<%# Bind("supplyPlanId") %>' CommandName="lbn_add" 
                                    ForeColor="Blue">生成月供应计划</asp:LinkButton>
                                &nbsp;&nbsp;
                                <asp:LinkButton ID="lbn_detail" runat="server" 
                                    CommandArgument='<%# Bind("supplyPlanId") %>' CommandName="lbn_detail" 
                                    ForeColor="Blue">月供应计划详情</asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="LinkButton3" runat="server" CommandName="outconfirm" 
                                    ForeColor="Blue" Visible ="false" >确认函</asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="LinkButton4" runat="server" CommandName="outex" 
                                    ForeColor="Blue" Visible ="false">催交函</asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="lbn_upSupplyDate" runat="server" 
                                    CommandArgument='<%# Bind("supplyPlanId") %>' CommandName="upSupplyDate" 
                                    ForeColor="Blue" Visible ="false">修改供货期</asp:LinkButton>
                                <asp:Label ID="lbl_supplyPlanId" runat="server" 
                                    Text='<%# Bind("supplyPlanId") %>' Visible="False"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="项目状态">
                            <ItemTemplate>
                                <asp:Label ID="lbl_flagEarlyGreen" runat="server" Font-Bold="True"  Text='<%# Bind("flagEarlyGreen") %>' Visible="false"></asp:Label>
                                <asp:Label ID="lbl_flagLateRed" runat="server" Font-Bold="True"  Text='<%# Bind("flagLateRed") %>' Visible="false"></asp:Label>
                                 <asp:Label ID="lbl_isMonthSupplyPlan" runat="server" Font-Bold="True"  Text='<%# Bind("isMonthSupplyPlan") %>' Visible="false"></asp:Label>
                                <asp:Label ID="lbl_early" runat="server" Font-Bold="True" ForeColor="Green" 
                                    Text="(有早到货情况)"></asp:Label>
                                <asp:Label ID="lbl_late" runat="server" Font-Bold="True" ForeColor="Red" 
                                    Text="(有晚到货情况)" Visible="False"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="remark" HeaderText="备注提醒" />
                        <asp:BoundField DataField="sname" HeaderText="供应商" />
                        <asp:BoundField DataField="projectName" HeaderText="项目名称" />
                        <asp:BoundField DataField="proid" HeaderText="项目编号" />
                        <asp:BoundField DataField="material" HeaderText="物料描述" />
                        <asp:TemplateField HeaderText="技术资料确认状态" Visible="False">
                            <ItemTemplate>
                                <asp:Label ID="lbl_technicalDataStatus" runat="server" Text='<%# Bind("technicalDataStatus") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" 
                                    Text='<%# Bind("technicalDataStatus") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="technicalDataStatusDate" HeaderText="技术资料确认日期" 
                            Visible="False" />
                        <asp:TemplateField HeaderText="供货期确认状态" Visible="False">
                            <ItemTemplate>
                                <asp:Label ID="lbl_supplyDateStatus" runat="server" Text='<%# Bind("supplyDateStatus") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox2" runat="server" 
                                    Text='<%# Bind("supplyDateStatus") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="supplyDateStatusDate" HeaderText="供货期确认日期" />
                        <asp:BoundField DataField="supplyDate" DataFormatString="{0:d}" 
                            HeaderText="供货期" />
                        <asp:TemplateField HeaderText="已入库数量">
                            <ItemTemplate>
                                <asp:Label ID="lbl_innums" runat="server" Text='<%# Bind("innums") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("innums") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="计划数量">
                            <ItemTemplate>
                                <asp:Label ID="lbl_num" runat="server" Text='<%# Bind("num") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("num") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="usework" HeaderText="需用单位" />
                        <asp:BoundField DataField="winBid" HeaderText="中标批次" Visible="False" />
                        <asp:BoundField DataField="purchaseid" HeaderText="采购订单号" />
                        <asp:TemplateField HeaderText="设备管理单位">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("equipmentManage") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbl_equipmentManage" runat="server" Text='<%# Bind("equipmentManage") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="sphone" HeaderText="供应商联系电话" />
                    </Columns>
                     <PagerStyle CssClass="mypager" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td style=" height:15px;  text-align:left;">
                
                <webdiyer:AspNetPager ID="AspNetPager1" runat="server" AlwaysShow="True" CurrentPageButtonPosition="Center"
                            PageSize="20" AlwaysShowFirstLastPageNumber="True" CustomInfoTextAlign="Left"
                    FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" NumericButtonCount="10"
                    PrevPageText="上一页" CssClass="paginator" CurrentPageButtonClass="" CustomInfoHTML="第 %CurrentPageIndex% 页|共 %PageCount% 页,%RecordCount%条记录 "
                    LayoutType="Table" ShowCustomInfoSection="Left" ShowNavigationToolTip="True"
                    ShowPageIndexBox="Always" PageIndexBoxType="DropDownList" TextAfterPageIndexBox="页"
                    TextBeforePageIndexBox="转到第" onpagechanged="AspNetPager1_PageChanged">
                </webdiyer:AspNetPager>

             
                
            </td>
        </tr>
        <tr>
            <td style=" height:15px;">
                <asp:Button ID="btn_reload" runat="server" onclick="btn_reload_Click" 
                    Visible="False" />
                <asp:Button ID="btn_out" runat="server" onclick="btn_out_Click" 
                    Text="导出Excel" />
            &nbsp;
                <asp:Button ID="btn_addMon" runat="server" onclick="btn_addMon_Click" 
                    Text="批量生成月供应计划" />
            </td>
        </tr>
        <tr>
            <td style=" height:15px; text-align:left;">
                <asp:DropDownList ID="ddl_equipmentMan" runat="server">
                </asp:DropDownList>
                <asp:Button ID="btn_setEqu" runat="server" Text="设置设备管理单位" OnClick="btn_setEqu_Click" />
                <asp:TextBox ID="txt_remark" runat="server" Width="280px"></asp:TextBox>
                <asp:Button ID="btn_upRemark" runat="server" OnClick="btn_upRemark_Click" Text="更新备注" />
            </td>
        </tr>
        </table>
</form></body></html>
